import time

from Unit_11.Page.Page1 import Page
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
class Page2(Page):
    # 定位
    # 点击我的酒仙网/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a
    dianjiuxian_loc=(By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[1]/div[1]/a')

    # 点击收货地址/html/body/div[4]/div[1]/div[2]/div[4]/a[3]
    dianshouhuo_loc=(By.XPATH,'/html/body/div[4]/div[1]/div[2]/div[4]/a[3]')
    # 输入姓名
    shouhuo_name_loc=(By.ID,'people')

    # 往下滑800



    # 封装
    # 点击我的酒仙网
    def dianjixian(self):
        self.click(self.dianjiuxian_loc)
    # 切换页面
    def qiehuan(self):
        self.new_window()

    def xiahua(self):
        self.scrool_x(800)
    def dianshouhuo(self):
        self.click(self.dianshouhuo_loc)
    def shouhuo_name(self):
        self.send_keys(self.shouhuo_name_loc,"陈景城")


    def test_jiegous(self):
        self.test_luoji()
        self.dianjixian()
        self.qiehuan()
        time.sleep(10)
        self.xiahua()
        self.dianshouhuo()
        self.shouhuo_name()
        time.sleep(2)
        d=Select(self.driver.find_element(By.ID,'province'))
        d.select_by_value("2")




